<%@ page language="java" import="com.alibaba.fastjson.JSONObject" pageEncoding="UTF-8" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="weaver.general.Util" %>
<%--试卷台账进行中和未开始的不允许删除--%>
<%
    JSONObject jsonData = new JSONObject();
    RecordSet rs = new RecordSet();
    String ids = Util.null2String(request.getParameter("ids"));
    int succcount = 0;
    int failcount = 0;
    rs.executeQuery("select id,sjzt from uf_sjtz where id in ("+ids+")");
    int counts = rs.getCounts();
    while (rs.next()) {
        String id = Util.null2String(rs.getString("id"));
        int sjzt = Util.getIntValue(rs.getString("sjzt"));
        if (sjzt==2) {
            rs.executeUpdate("update uf_sjtz set sfysc=0 where id=? ",id);
            succcount++;
        }else {
            failcount++;
        }

    }
    jsonData.put( "counts", counts );
    jsonData.put( "succcount", succcount );
    jsonData.put( "failcount", failcount );
    out.print( jsonData.toJSONString() );
%>






